<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('index')}">{:lang('ADMIN_VALIDE_INDEX')}</a></li>
			<li><a href="{:url('add')}">{:lang('ADMIN_VALIDE_ADD')}</a></li>
            <li class="active"><a>{:lang('ADMIN_VALIDE_EDIT')}</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" id="myform"  action="{:url('editPost')}">
			<div class="form-group">
				<label  class="col-sm-2 control-label"><span class="form-required">*</span>关键字</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" required  name="key_c" value="{$result.key_c}">
				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label"><span class="form-required">*</span>配置名</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" required name="name_c" value="{$result.name_c}">
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>类型</label>
				<div class="col-md-6 col-sm-10">
					<label class="radio-inline">
						<input type="radio" name="type" value="integer" checked > integer
					</label>
					<label class="radio-inline">
                        <input type="radio" name="type" value="float" <if condition="$result.type eq 'float'">checked</if> >float 
					</label>
                    <label class="radio-inline">
						<input type="radio" name="type" value="string" <if condition="$result.type eq 'string'">checked</if> >string 
					</label>
                    <label class="radio-inline">
						<input type="radio" name="type" value="boolean" <if condition="$result.type eq 'boolean'">checked</if> >boolean 
					</label>
                    <label class="radio-inline">
						<input type="radio" name="type" value="array" <if condition="$result.type eq 'array'">checked</if> >array 
					</label>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-2 control-label">规则</label>
                <div class="col-md-6 col-sm-10">
                    <label class="checkbox-inline">
                        <input type="checkbox" value="1" {$result.required} id="required"/>必填
                    </label>
                    <br/> 
                    <label class="radio-inline">
                        <input type="radio"  name="way" data-checked="0"  value="1" <if condition="$result.min!='' || $result.max!=''">checked</if> />范围
                    </label>
                    <input type="number" name="min" class="form-control" style="width:100px;display:inline-block;margin-left: 20px;" value="{$result.min}"/>--<input type="number" name="max" class="form-control" style="width:100px;display:inline-block" value="{$result.max}"/>
                    <br/>
                     <label class="radio-inline">
                        <input type="radio"  name="way" data-checked="0" value="2"  <if condition="$result.in!=''">checked</if> />集合
                    </label>
                    <input type="text"  name="set" value="{$result.in}" class="form-control" onkeyup="javascript:this.value=this.value.replace(/，/ig,',');" style="display:inline-block;margin-left: 20px;width:300px;margin-top: 10px" />用逗号分隔
				</div>
            </div>
            <div class="form-group">
				<label  class="col-sm-2 control-label">组ID</label>
				<div class="col-md-6 col-sm-10">
                    <input type="number" class="form-control"   name="special" value="{$result.special}">
				</div>
			</div>
            <div class="form-group">
				<label  class="col-sm-2 control-label">默认值</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" name="value_c" value="{$result.value_c}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>描述</label>
				<div class="col-md-6 col-sm-10">
					<textarea class="form-control" name="descr" required id="descr" >{$result.descr}</textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
                    <input type="hidden" name="id" value="{$result.id}"/>
					<button type="submit" onclick="return formValidate()" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
    <script src="__STATIC__/js/game.js"></script>
</body>
</html>